package com.me.jingdongshop.ui.holder;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.me.common.base.Global;
import com.me.common.base.OttoBus;
import com.me.common.ui.BaseAdapterLV;
import com.me.common.ui.BaseHolderLV;
import com.me.jingdongshop.R;


/**
 * Created by CJC on 2017/5/8.
 */

public class HotSearchHolder extends BaseHolderLV<String> {

    private TextView tvSearchGvItem;

    public HotSearchHolder(Context context, ViewGroup parent, BaseAdapterLV<String> adapter, int position, String bean) {
        super(context, parent, adapter, position, bean);
    }

    @Override
    public View onCreateView(Context context, ViewGroup parent) {
        View hotSearchItem = LayoutInflater.from(context).inflate(R.layout.search_pager_gv_item,parent,false);
        tvSearchGvItem = (TextView) hotSearchItem.findViewById(R.id.tv_search_gv_item);
        return hotSearchItem;
    }

    @Override
    protected void onRefreshView(final String bean, final int position) {

        tvSearchGvItem.setText(bean);
        tvSearchGvItem.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                OttoBus.getDefault().post(bean);
            }
        });
    }

}
